PEGetNthGroupSortField

Use PEGetNthGroupSortField to retrieve information about one of the group sort fields in the specified report. This function is used with PEGetHandleString. PEGetNthGroupSortField returns the name of the field and the direction (ascending or descending) of the sort. See Crystal Report Engine API variable length strings for additional information.

This function is typically used as one of a series of functions (PEGetNGroupSortFields) called once; PEGetNthGroupSortField and PEGetHandleString called as many times as needed to identify the correct group sort field; and PESetNthAlertConditionFormula called once when the correct sort field is identified. The series can be used in a Custom-Print Link to identify and then change an existing group sort field and/or sort order in response to a user selection at print time.

C Syntax
BOOL CRPE_API PEGetNthGroupSortField (
        short printJob,
        short sortFieldN,
        HANDLE FAR *nameHandle,
        short FAR *nameLength,
        short FAR *direction );
Parameters

printJob

Specifies the print job from which you want to gather group sort field information.

sortFieldN

Specifies the 0-based number of the group sort field that you want to retrieve. The first group sort field is field 0. If the report has N sort fields, the function can be called with sortFieldN between 0 and N-1.

nameHandle

Specifies a pointer to the handle of the string containing the sort field name.

nameLength

Specifies a pointer to the length of the field name string (in bytes) including the terminating byte.

direction

Specifies a pointer to the sort direction. Uses one of the PE_SF_XXX Sort Order Constants.

Returns
Remarks

To find out top/bottom n group sort information, use PEGetGroupOptions.

VB Syntax
Declare Function PEGetNthGroupSortField Lib "crpe32.dll" ( _
    ByVal printJob As Integer, ByVal SortFieldN As Integer, _
    NameHandle As Long, NameLength As Integer, Direction As Integer _
    ) As Integer
Delphi Syntax
function PEGetNthGroupSortField (
    printJob: Word;
     sortFieldN: integer;
     var nameHandle: HWnd;
     var nameLength: Word;
     var direction: Word
    ): Bool stdcall;


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com